package org.eae.eldf.dao.module.impl;

import java.util.ArrayList;
import java.util.List;
import org.eae.eldf.dao.module.IModuleCompanyDao;
import org.eae.eldf.entity.module.ModuleCompany;
import org.eae.eldf.framework.dao.JdbcDaoImpl;
import org.eae.eldf.framework.pager.Pagination;
import org.eae.eldf.framework.utils.StringUtil;
import org.springframework.stereotype.Repository;
@Repository
public class ModuleCompanyDaoImpl extends JdbcDaoImpl implements IModuleCompanyDao{

	@Override
	public Pagination<ModuleCompany> queryListModuleCompany(
			Pagination<ModuleCompany> pager, String searchValue) {
		String sql="select * from module_company mc ";
		List<Object> pars=new ArrayList<Object>();
		if(!StringUtil.isNullOrBlank(searchValue)){
			sql+="where mc.company_code  like ?";
			pars.add("%"+searchValue+"%");
		}
		return this.queryListByPage(pager, sql,pars,ModuleCompany.class);
	}
	@Override
	public List<ModuleCompany> findByModuleCompanyByCompanyCode(String id) {
		String sql = "select * from module_company mc where mc.company_code = ?";
		return this.queryBySQL(sql,new Object[]{id}, ModuleCompany.class);
	}

	

}


